//
// Created by Administrator on 2021/10/16.
//
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <climits>

using namespace std;

class Solution {
public:
    string restoreString(string s, vector<int> &indices) {
        string ans(s.size(), '*');
        for (int i = 0; i < indices.size(); ++i) {
            ans[indices[i]] = s[i];
        }
        return ans;
    }
};

int main() {
    Solution solution;
    vector<int> indices{4, 5, 6, 7, 0, 2, 1, 3};
    cout << solution.restoreString("codeleet", indices) << endl;
    return 0;
}
